home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / AIncludes / QD3D.a < prev    next >
Encoding:
Text File  |  1998-04-09  |  37.5 KB  |  1,204 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3D.a
  3. ;
  4. ;    Contains:    Base types for Quickdraw 3D                            
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    QuickTime 3.0
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  19. __QD3D__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.  
  25.     IF TARGET_OS_MAC THEN
  26.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  27.     include 'MacTypes.a'
  28.     ENDIF
  29.     ENDIF    ; TARGET_OS_MAC
  30.     IF TARGET_OS_MAC THEN
  31.     OS_MACINTOSH: SET 1
  32.     OS_WIN32: SET 0
  33.     OS_UNIX: SET 0
  34.     OS_NEXT: SET 0
  35.     WINDOW_SYSTEM_MACINTOSH: SET 1
  36.     WINDOW_SYSTEM_WIN32: SET 0
  37.     WINDOW_SYSTEM_X11: SET 0
  38.     WINDOW_SYSTEM_NEXT: SET 0
  39.     ENDIF    ; TARGET_OS_MAC
  40.  
  41. ; ******************************************************************************
  42. ; **                                                                             **
  43. ; **                                NULL definition                                 **
  44. ; **                                                                             **
  45. ; ****************************************************************************
  46.  
  47. ; ******************************************************************************
  48. ; **                                                                             **
  49. ; **                                    Objects                                     **
  50. ; **                                                                             **
  51. ; ****************************************************************************
  52.  
  53. ; * Everything in QuickDraw 3D is an OBJECT: a bunch of data with a type,
  54. ; * deletion, duplication, and i/o methods.
  55.  
  56. ; typedef long                             TQ3ObjectType
  57.  
  58.  
  59.  
  60. ;  
  61. ; * There are four subclasses of OBJECT:
  62. ; *    an ELEMENT, which is data that is placed in a SET
  63. ; *    a SHAREDOBJECT, which is reference-counted data that is shared
  64. ; *    VIEWs, which maintain state information for an image
  65. ; *    a PICK, which used to query a VIEW
  66.  
  67. ; typedef TQ3Object                     TQ3ElementObject
  68.  
  69. ; typedef TQ3Object                     TQ3SharedObject
  70.  
  71. ; typedef TQ3Object                     TQ3ViewObject
  72.  
  73. ; typedef TQ3Object                     TQ3PickObject
  74.  
  75. ; * There are several types of SharedObjects:
  76. ; *    RENDERERs, which paint to a drawContext
  77. ; *    DRAWCONTEXTs, which are an interface to a device 
  78. ; *    SETs, which maintains "mathematical sets" of ELEMENTs
  79. ; *    FILEs, which maintain state information for a metafile
  80. ; *    SHAPEs, which affect the state of the View
  81. ; *    SHAPEPARTs, which contain geometry-specific data about a picking hit
  82. ; *    CONTROLLERSTATEs, which hold state of the output channels for a CONTROLLER
  83. ; *    TRACKERs, which represent a position and orientation in the user interface
  84. ; *  STRINGs, which are abstractions of text string data.
  85. ; *    STORAGE, which is an abstraction for stream-based data storage (files, memory)
  86. ; *    TEXTUREs, for sharing bitmap information for TEXTURESHADERS
  87. ; *    VIEWHINTs, which specifies viewing preferences in FILEs
  88.  
  89. ; typedef TQ3SharedObject                 TQ3RendererObject
  90.  
  91. ; typedef TQ3SharedObject                 TQ3DrawContextObject
  92.  
  93. ; typedef TQ3SharedObject                 TQ3SetObject
  94.  
  95. ; typedef TQ3SharedObject                 TQ3FileObject
  96.  
  97. ; typedef TQ3SharedObject                 TQ3ShapeObject
  98.  
  99. ; typedef TQ3SharedObject                 TQ3ShapePartObject
  100.  
  101. ; typedef TQ3SharedObject                 TQ3ControllerStateObject
  102.  
  103. ; typedef TQ3SharedObject                 TQ3TrackerObject
  104.  
  105. ; typedef TQ3SharedObject                 TQ3StringObject
  106.  
  107. ; typedef TQ3SharedObject                 TQ3StorageObject
  108.  
  109. ; typedef TQ3SharedObject                 TQ3TextureObject
  110.  
  111. ; typedef TQ3SharedObject                 TQ3ViewHintsObject
  112.  
  113. ; * There is one types of SET:
  114. ; *    ATTRIBUTESETs, which contain ATTRIBUTEs which are inherited 
  115.  
  116. ; typedef TQ3SetObject                     TQ3AttributeSet
  117.  
  118. ; * There are many types of SHAPEs:
  119. ; *    LIGHTs, which affect how the RENDERER draws 3-D cues
  120. ; *    CAMERAs, which affects the location and orientation of the RENDERER in space
  121. ; *    GROUPs, which may contain any number of SHARED OBJECTS
  122. ; *    GEOMETRYs, which are representations of three-dimensional data
  123. ; *    SHADERs, which affect how colors are drawn on a geometry
  124. ; *    STYLEs, which affect how the RENDERER paints to the DRAWCONTEXT
  125. ; *    TRANSFORMs, which affect the coordinate system in the VIEW
  126. ; *    REFERENCEs, which are references to objects in FILEs
  127. ; *  UNKNOWN, which hold unknown objects read from a metafile.
  128.  
  129. ; typedef TQ3ShapeObject                 TQ3GroupObject
  130.  
  131. ; typedef TQ3ShapeObject                 TQ3GeometryObject
  132.  
  133. ; typedef TQ3ShapeObject                 TQ3ShaderObject
  134.  
  135. ; typedef TQ3ShapeObject                 TQ3StyleObject
  136.  
  137. ; typedef TQ3ShapeObject                 TQ3TransformObject
  138.  
  139. ; typedef TQ3ShapeObject                 TQ3LightObject
  140.  
  141. ; typedef TQ3ShapeObject                 TQ3CameraObject
  142.  
  143. ; typedef TQ3ShapeObject                 TQ3UnknownObject
  144.  
  145. ; typedef TQ3ShapeObject                 TQ3ReferenceObject
  146.  
  147. ; * For now, there is only one type of SHAPEPARTs:
  148. ; *    MESHPARTs, which describe some part of a mesh
  149.  
  150. ; typedef TQ3ShapePartObject             TQ3MeshPartObject
  151.  
  152. ; * There are three types of MESHPARTs:
  153. ; *    MESHFACEPARTs, which describe a face of a mesh
  154. ; *    MESHEDGEPARTs, which describe a edge of a mesh
  155. ; *    MESHVERTEXPARTs, which describe a vertex of a mesh
  156.  
  157. ; typedef TQ3MeshPartObject             TQ3MeshFacePartObject
  158.  
  159. ; typedef TQ3MeshPartObject             TQ3MeshEdgePartObject
  160.  
  161. ; typedef TQ3MeshPartObject             TQ3MeshVertexPartObject
  162.  
  163. ; * A DISPLAY Group can be drawn to a view
  164.  
  165. ; typedef TQ3GroupObject                 TQ3DisplayGroupObject
  166.  
  167. ; * There are many types of SHADERs:
  168. ; *    SURFACESHADERs, which affect how the surface of a geometry is painted
  169. ; *    ILLUMINATIONSHADERs, which affect how lights affect the color of a surface
  170.  
  171. ; typedef TQ3ShaderObject                 TQ3SurfaceShaderObject
  172.  
  173. ; typedef TQ3ShaderObject                 TQ3IlluminationShaderObject
  174.  
  175. ; * A handle to an object in a group
  176.  
  177.  
  178.  
  179. ;  
  180. ; * TQ3ObjectClassNameString is used for the class name of an object
  181.  
  182.  
  183. kQ3StringMaximumLength            EQU        1024
  184. TQ3ObjectClassNameString RECORD 0
  185. elements                 ds.b    1024
  186. sizeof                     EQU *                    ; size:   $400 (1024)
  187.                         ENDR
  188.  
  189.  
  190. ; ******************************************************************************
  191. ; **                                                                             **
  192. ; **                            Client/Server Things                             **
  193. ; **                                                                             **
  194. ; ****************************************************************************
  195.  
  196. ; typedef void *                        TQ3ControllerRef
  197.  
  198. ; ******************************************************************************
  199. ; **                                                                             **
  200. ; **                            Flags and Switches                                 **
  201. ; **                                                                             **
  202. ; ****************************************************************************
  203.  
  204.  
  205. ; typedef long                            TQ3Boolean
  206. kQ3False                        EQU        0
  207. kQ3True                            EQU        1
  208.  
  209. ; typedef long                            TQ3Switch
  210. kQ3Off                            EQU        0
  211. kQ3On                            EQU        1
  212.  
  213. ; typedef long                            TQ3Status
  214. kQ3Failure                        EQU        0
  215. kQ3Success                        EQU        1
  216.  
  217. ; typedef long                            TQ3Axis
  218. kQ3AxisX                        EQU        0
  219. kQ3AxisY                        EQU        1
  220. kQ3AxisZ                        EQU        2
  221.  
  222. ; typedef long                            TQ3PixelType
  223. kQ3PixelTypeRGB32                EQU        0                    ; Alpha:8 (ignored), R:8, G:8, B:8    
  224. kQ3PixelTypeARGB32                EQU        1                    ; Alpha:8, R:8, G:8, B:8             
  225. kQ3PixelTypeRGB16                EQU        2                    ; Alpha:1 (ignored), R:5, G:5, B:5    
  226. kQ3PixelTypeARGB16                EQU        3                    ; Alpha:1, R:5, G:5, B:5             
  227. kQ3PixelTypeRGB16_565            EQU        4                    ; Win32 only: 16 bits/pixel, R:5, G:6, B:5        
  228. kQ3PixelTypeRGB24                EQU        5                    ; Win32 only: 24 bits/pixel, R:8, G:8, B:8        
  229.  
  230. ; typedef long                            TQ3Endian
  231. kQ3EndianBig                    EQU        0
  232. kQ3EndianLittle                    EQU        1
  233.  
  234. ; typedef long                            TQ3EndCapMasks
  235. kQ3EndCapNone                    EQU        0
  236. kQ3EndCapMaskTop                EQU        $01
  237. kQ3EndCapMaskBottom                EQU        $02
  238. kQ3EndCapMaskInterior            EQU        $04
  239. ; typedef unsigned long                 TQ3EndCap
  240.  
  241.  
  242. kQ3ArrayIndexNULL                EQU        -1
  243. ; ******************************************************************************
  244. ; **                                                                             **
  245. ; **                        Point and Vector Definitions                         **
  246. ; **                                                                             **
  247. ; ****************************************************************************
  248.  
  249. TQ3Vector2D                RECORD 0
  250. x                         ds        Float32            ; offset: $0 (0)
  251. y                         ds        Float32            ; offset: $4 (4)
  252. sizeof                     EQU *                    ; size:   $8 (8)
  253.                         ENDR
  254. TQ3Vector3D                RECORD 0
  255. x                         ds        Float32            ; offset: $0 (0)
  256. y                         ds        Float32            ; offset: $4 (4)
  257. z                         ds        Float32            ; offset: $8 (8)
  258. sizeof                     EQU *                    ; size:   $C (12)
  259.                         ENDR
  260. TQ3Point2D                RECORD 0
  261. x                         ds        Float32            ; offset: $0 (0)
  262. y                         ds        Float32            ; offset: $4 (4)
  263. sizeof                     EQU *                    ; size:   $8 (8)
  264.                         ENDR
  265. TQ3Point3D                RECORD 0
  266. x                         ds        Float32            ; offset: $0 (0)
  267. y                         ds        Float32            ; offset: $4 (4)
  268. z                         ds        Float32            ; offset: $8 (8)
  269. sizeof                     EQU *                    ; size:   $C (12)
  270.                         ENDR
  271. TQ3RationalPoint4D        RECORD 0
  272. x                         ds        Float32            ; offset: $0 (0)
  273. y                         ds        Float32            ; offset: $4 (4)
  274. z                         ds        Float32            ; offset: $8 (8)
  275. w                         ds        Float32            ; offset: $C (12)
  276. sizeof                     EQU *                    ; size:   $10 (16)
  277.                         ENDR
  278. TQ3RationalPoint3D        RECORD 0
  279. x                         ds        Float32            ; offset: $0 (0)
  280. y                         ds        Float32            ; offset: $4 (4)
  281. w                         ds        Float32            ; offset: $8 (8)
  282. sizeof                     EQU *                    ; size:   $C (12)
  283.                         ENDR
  284. ; ******************************************************************************
  285. ; **                                                                             **
  286. ; **                                Quaternion                                     **
  287. ; **                                                                             **
  288. ; ****************************************************************************
  289.  
  290. TQ3Quaternion            RECORD 0
  291. w                         ds        Float32            ; offset: $0 (0)
  292. x                         ds        Float32            ; offset: $4 (4)
  293. y                         ds        Float32            ; offset: $8 (8)
  294. z                         ds        Float32            ; offset: $C (12)
  295. sizeof                     EQU *                    ; size:   $10 (16)
  296.                         ENDR
  297. ; ******************************************************************************
  298. ; **                                                                             **
  299. ; **                                Ray Definition                                 **
  300. ; **                                                                             **
  301. ; ****************************************************************************
  302.  
  303. TQ3Ray3D                RECORD 0
  304. origin                     ds        TQ3Point3D        ; offset: $0 (0)
  305. direction                 ds        TQ3Vector3D        ; offset: $C (12)
  306. sizeof                     EQU *                    ; size:   $18 (24)
  307.                         ENDR
  308. ; ******************************************************************************
  309. ; **                                                                             **
  310. ; **                        Parameterization Data Structures                     **
  311. ; **                                                                             **
  312. ; ****************************************************************************
  313.  
  314. TQ3Param2D                RECORD 0
  315. u                         ds        Float32            ; offset: $0 (0)
  316. v                         ds        Float32            ; offset: $4 (4)
  317. sizeof                     EQU *                    ; size:   $8 (8)
  318.                         ENDR
  319. TQ3Param3D                RECORD 0
  320. u                         ds        Float32            ; offset: $0 (0)
  321. v                         ds        Float32            ; offset: $4 (4)
  322. w                         ds        Float32            ; offset: $8 (8)
  323. sizeof                     EQU *                    ; size:   $C (12)
  324.                         ENDR
  325. TQ3Tangent2D            RECORD 0
  326. uTangent                 ds        TQ3Vector3D        ; offset: $0 (0)
  327. vTangent                 ds        TQ3Vector3D        ; offset: $C (12)
  328. sizeof                     EQU *                    ; size:   $18 (24)
  329.                         ENDR
  330. TQ3Tangent3D            RECORD 0
  331. uTangent                 ds        TQ3Vector3D        ; offset: $0 (0)
  332. vTangent                 ds        TQ3Vector3D        ; offset: $C (12)
  333. wTangent                 ds        TQ3Vector3D        ; offset: $18 (24)
  334. sizeof                     EQU *                    ; size:   $24 (36)
  335.                         ENDR
  336. ; ******************************************************************************
  337. ; **                                                                             **
  338. ; **                        Polar and Spherical Coordinates                         **
  339. ; **                                                                             **
  340. ; ****************************************************************************
  341.  
  342. TQ3PolarPoint            RECORD 0
  343. r                         ds        Float32            ; offset: $0 (0)
  344. theta                     ds        Float32            ; offset: $4 (4)
  345. sizeof                     EQU *                    ; size:   $8 (8)
  346.                         ENDR
  347. TQ3SphericalPoint        RECORD 0
  348. rho                         ds        Float32            ; offset: $0 (0)
  349. theta                     ds        Float32            ; offset: $4 (4)
  350. phi                         ds        Float32            ; offset: $8 (8)
  351. sizeof                     EQU *                    ; size:   $C (12)
  352.                         ENDR
  353. ; ******************************************************************************
  354. ; **                                                                             **
  355. ; **                            Color Definition                                 **
  356. ; **                                                                             **
  357. ; ****************************************************************************
  358.  
  359. TQ3ColorRGB                RECORD 0
  360. r                         ds        Float32            ; offset: $0 (0)
  361. g                         ds        Float32            ; offset: $4 (4)
  362. b                         ds        Float32            ; offset: $8 (8)
  363. sizeof                     EQU *                    ; size:   $C (12)
  364.                         ENDR
  365. TQ3ColorARGB            RECORD 0
  366. a                         ds        Float32            ; offset: $0 (0)
  367. r                         ds        Float32            ; offset: $4 (4)
  368. g                         ds        Float32            ; offset: $8 (8)
  369. b                         ds        Float32            ; offset: $C (12)
  370. sizeof                     EQU *                    ; size:   $10 (16)
  371.                         ENDR
  372. ; ******************************************************************************
  373. ; **                                                                             **
  374. ; **                                    Vertices                                 **
  375. ; **                                                                             **
  376. ; ****************************************************************************
  377.  
  378. TQ3Vertex3D                RECORD 0
  379. point                     ds        TQ3Point3D        ; offset: $0 (0)
  380. attributeSet             ds.l    1                ; offset: $C (12)
  381. sizeof                     EQU *                    ; size:   $10 (16)
  382.                         ENDR
  383. ; ******************************************************************************
  384. ; **                                                                             **
  385. ; **                                    Matrices                                 **
  386. ; **                                                                             **
  387. ; ****************************************************************************
  388.  
  389. TQ3Matrix3x3            RECORD 0
  390. value                     ds.b    3 * 3 * Float32.sizeof ; offset: $0 (0)
  391. sizeof                     EQU *                    ; size:   $24 (36)
  392.                         ENDR
  393. TQ3Matrix4x4            RECORD 0
  394. value                     ds.b    4 * 4 * Float32.sizeof ; offset: $0 (0)
  395. sizeof                     EQU *                    ; size:   $40 (64)
  396.                         ENDR
  397. ; ******************************************************************************
  398. ; **                                                                             **
  399. ; **                                Bitmap/Pixmap                                 **
  400. ; **                                                                             **
  401. ; ****************************************************************************
  402.  
  403. TQ3Pixmap                RECORD 0
  404. image                     ds.l    1                ; offset: $0 (0)
  405. width                     ds.l    1                ; offset: $4 (4)
  406. height                     ds.l    1                ; offset: $8 (8)
  407. rowBytes                 ds.l    1                ; offset: $C (12)
  408. pixelSize                 ds.l    1                ; offset: $10 (16)        ;  MUST be 16 or 32 to use with the    Interactive Renderer on Mac OS
  409. pixelType                 ds.l    1                ; offset: $14 (20)
  410. bitOrder                 ds.l    1                ; offset: $18 (24)
  411. byteOrder                 ds.l    1                ; offset: $1C (28)
  412. sizeof                     EQU *                    ; size:   $20 (32)
  413.                         ENDR
  414. TQ3StoragePixmap        RECORD 0
  415. image                     ds.l    1                ; offset: $0 (0)
  416. width                     ds.l    1                ; offset: $4 (4)
  417. height                     ds.l    1                ; offset: $8 (8)
  418. rowBytes                 ds.l    1                ; offset: $C (12)
  419. pixelSize                 ds.l    1                ; offset: $10 (16)        ;  MUST be 16 or 32 to use with the    Interactive Renderer on Mac OS
  420. pixelType                 ds.l    1                ; offset: $14 (20)
  421. bitOrder                 ds.l    1                ; offset: $18 (24)
  422. byteOrder                 ds.l    1                ; offset: $1C (28)
  423. sizeof                     EQU *                    ; size:   $20 (32)
  424.                         ENDR
  425. TQ3Bitmap                RECORD 0
  426. image                     ds.l    1                ; offset: $0 (0)
  427. width                     ds.l    1                ; offset: $4 (4)
  428. height                     ds.l    1                ; offset: $8 (8)
  429. rowBytes                 ds.l    1                ; offset: $C (12)
  430. bitOrder                 ds.l    1                ; offset: $10 (16)
  431. sizeof                     EQU *                    ; size:   $14 (20)
  432.                         ENDR
  433. TQ3MipmapImage            RECORD 0
  434. ;  An image for use as a texture mipmap  
  435. width                     ds.l    1                ; offset: $0 (0)        ;  Width of mipmap, must be power of 2   
  436. height                     ds.l    1                ; offset: $4 (4)        ;  Height of mipmap, must be power of 2  
  437. rowBytes                 ds.l    1                ; offset: $8 (8)        ;  Rowbytes of mipmap                    
  438. offset                     ds.l    1                ; offset: $C (12)        ;  Offset from image base to this mipmap 
  439. sizeof                     EQU *                    ; size:   $10 (16)
  440.                         ENDR
  441. TQ3Mipmap                RECORD 0
  442. image                     ds.l    1                ; offset: $0 (0)        ;  Data containing the texture map and      
  443. ;  if (useMipmapping==kQ3True) the          
  444. ;  mipmap data                              
  445. useMipmapping             ds.l    1                ; offset: $4 (4)        ;  True if mipmapping should be used      
  446. ;  and all mipmaps have been provided    
  447. pixelType                 ds.l    1                ; offset: $8 (8)
  448. bitOrder                 ds.l    1                ; offset: $C (12)
  449. byteOrder                 ds.l    1                ; offset: $10 (16)
  450. reserved                 ds.l    1                ; offset: $14 (20)        ;  leave NULL for next version             
  451. mipmaps                     ds.b    32 * TQ3MipmapImage.sizeof ; offset: $18 (24) ;  The actual number of mipmaps is determined from the size of the first mipmap 
  452. sizeof                     EQU *                    ; size:   $218 (536)
  453.                         ENDR
  454.  
  455. ; ******************************************************************************
  456. ; **                                                                             **
  457. ; **                        Higher dimension quantities                             **
  458. ; **                                                                             **
  459. ; ****************************************************************************
  460.  
  461. TQ3Area                    RECORD 0
  462. min                         ds        TQ3Point2D        ; offset: $0 (0)
  463. max                         ds        TQ3Point2D        ; offset: $8 (8)
  464. sizeof                     EQU *                    ; size:   $10 (16)
  465.                         ENDR
  466. TQ3PlaneEquation        RECORD 0
  467. normal                     ds        TQ3Vector3D        ; offset: $0 (0)
  468. constant                 ds        Float32            ; offset: $C (12)
  469. sizeof                     EQU *                    ; size:   $10 (16)
  470.                         ENDR
  471. TQ3BoundingBox            RECORD 0
  472. min                         ds        TQ3Point3D        ; offset: $0 (0)
  473. max                         ds        TQ3Point3D        ; offset: $C (12)
  474. isEmpty                     ds.l    1                ; offset: $18 (24)
  475. sizeof                     EQU *                    ; size:   $1C (28)
  476.                         ENDR
  477. TQ3BoundingSphere        RECORD 0
  478. origin                     ds        TQ3Point3D        ; offset: $0 (0)
  479. radius                     ds        Float32            ; offset: $C (12)
  480. isEmpty                     ds.l    1                ; offset: $10 (16)
  481. sizeof                     EQU *                    ; size:   $14 (20)
  482.                         ENDR
  483. ; *    The TQ3ComputeBounds flag passed to StartBoundingBox or StartBoundingSphere
  484. ; *    calls in the View. It's a hint to the system as to how it should 
  485. ; *    compute the bbox of a shape:
  486. ; *
  487. ; *    kQ3ComputeBoundsExact:    
  488. ; *        Vertices of shapes are transformed into world space and
  489. ; *        the world space bounding box is computed from them.  Slow!
  490. ; *    
  491. ; *    kQ3ComputeBoundsApproximate: 
  492. ; *        A local space bounding box is computed from a shape's
  493. ; *        vertices.  This bbox is then transformed into world space,
  494. ; *        and its bounding box is taken as the shape's approximate
  495. ; *        bbox.  Fast but the bbox is larger than optimal.
  496.  
  497.  
  498. ; typedef long                            TQ3ComputeBounds
  499. kQ3ComputeBoundsExact            EQU        0
  500. kQ3ComputeBoundsApproximate        EQU        1
  501.  
  502. ; ******************************************************************************
  503. ; **                                                                             **
  504. ; **                            Object System Types                                 **
  505. ; **                                                                             **
  506. ; ****************************************************************************
  507.  
  508.  
  509.  
  510.  
  511. ; typedef unsigned long                 TQ3XMethodType
  512.  
  513. ; * Object methods
  514.  
  515. ;  
  516. ; *  Return true from the metahandler if this 
  517. ; *  object can be submitted in a rendering loop 
  518.  
  519. ; * MetaHandler:
  520. ; *        When you give a metahandler to QuickDraw 3D, it is called multiple 
  521. ; *        times to build method tables, and then is thrown away. You are 
  522. ; *        guaranteed that your metahandler will never be called again after a 
  523. ; *        call that was passed a metahandler returns.
  524. ; *
  525. ; *        Your metahandler should contain a switch on the methodType passed to it
  526. ; *        and should return the corresponding method as an TQ3XFunctionPointer.
  527. ; *
  528. ; *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  529. ; *        passed a methodType that you do not understand, ALWAYS return NULL.
  530. ; *
  531. ; *        These types here are prototypes of how your functions should look.
  532.  
  533. ; * See QD3DIO.h for the IO method types: 
  534. ; *        ObjectReadData, ObjectTraverse, ObjectWrite
  535.  
  536.  
  537. ; ******************************************************************************
  538. ; **                                                                             **
  539. ; **                                Set Types                                     **
  540. ; **                                                                             **
  541. ; ****************************************************************************
  542.  
  543. ; typedef long                             TQ3ElementType
  544.  
  545.  
  546. kQ3ElementTypeNone                EQU        0
  547. kQ3ElementTypeUnknown            EQU        32
  548. kQ3ElementTypeSet                EQU        33
  549.  
  550. ;  
  551. ; *    kQ3ElementTypeUnknown is a TQ3Object. 
  552. ; *    
  553. ; *        Do Q3Set_Add(s, ..., &obj) or Q3Set_Get(s, ..., &obj);
  554. ; *        
  555. ; *        Note that the object is always referenced when copying around. 
  556. ; *        
  557. ; *        Generally, it is an Unknown object, a Group of Unknown objects, or a 
  558. ; *        group of other "objects" which have been found in the metafile and
  559. ; *        have no attachment method to their parent. Be prepared to handle
  560. ; *        any or all of these cases if you actually access the set on a shape.
  561. ; *
  562. ; *    kQ3ElementTypeSet is a TQ3SetObject. 
  563. ; *    
  564. ; *        Q3Shape_GetSet(s,&o) is eqivalent to 
  565. ; *            Q3Shape_GetElement(s, kQ3ElementTypeSet, &o)
  566. ; *            
  567. ; *        Q3Shape_SetSet(s,o)  is eqivalent to 
  568. ; *            Q3Shape_SetElement(s, kQ3ElementTypeSet, &o)
  569. ; *    
  570. ; *        Note that the object is always referenced when copying around. 
  571. ; *        
  572. ; *    See the note below about the Set and Shape changes.
  573.  
  574.  
  575. ; ******************************************************************************
  576. ; **                                                                             **
  577. ; **                            Object System Macros                             **
  578. ; **                                                                             **
  579. ; ****************************************************************************
  580.  
  581. ; ******************************************************************************
  582. ; **                                                                             **
  583. ; **                                Object Types                                 **
  584. ; **                                                                             **
  585. ; ****************************************************************************
  586.  
  587. ; * Note:    a call to Q3Foo_GetType will return a value kQ3FooTypeBar
  588. ; *            e.g. Q3Shared_GetType(object) returns kQ3SharedTypeShape, etc.
  589.  
  590.  
  591.  
  592. kQ3ObjectTypeInvalid            EQU        0
  593. kQ3ObjectTypeView                EQU        'view'
  594. kQ3ObjectTypeElement            EQU        'elmn'
  595. kQ3ElementTypeAttribute            EQU        'eatt'
  596. kQ3ObjectTypePick                EQU        'pick'
  597. kQ3PickTypeWindowPoint            EQU        'pkwp'
  598. kQ3PickTypeWindowRect            EQU        'pkwr'
  599. kQ3ObjectTypeShared                EQU        'shrd'
  600. kQ3SharedTypeRenderer            EQU        'rddr'
  601. kQ3RendererTypeWireFrame        EQU        'wrfr'
  602. kQ3RendererTypeGeneric            EQU        'gnrr'
  603. kQ3RendererTypeInteractive        EQU        'ctwn'
  604. kQ3SharedTypeShape                EQU        'shap'
  605. kQ3ShapeTypeGeometry            EQU        'gmtr'
  606. kQ3GeometryTypeBox                EQU        'box '
  607. kQ3GeometryTypeGeneralPolygon    EQU        'gpgn'
  608. kQ3GeometryTypeLine                EQU        'line'
  609. kQ3GeometryTypeMarker            EQU        'mrkr'
  610. kQ3GeometryTypePixmapMarker        EQU        'mrkp'
  611. kQ3GeometryTypeMesh                EQU        'mesh'
  612. kQ3GeometryTypeNURBCurve        EQU        'nrbc'
  613. kQ3GeometryTypeNURBPatch        EQU        'nrbp'
  614. kQ3GeometryTypePoint            EQU        'pnt '
  615. kQ3GeometryTypePolygon            EQU        'plyg'
  616. kQ3GeometryTypePolyLine            EQU        'plyl'
  617. kQ3GeometryTypeTriangle            EQU        'trng'
  618. kQ3GeometryTypeTriGrid            EQU        'trig'
  619. kQ3GeometryTypeCone                EQU        'cone'
  620. kQ3GeometryTypeCylinder            EQU        'cyln'
  621. kQ3GeometryTypeDisk                EQU        'disk'
  622. kQ3GeometryTypeEllipse            EQU        'elps'
  623. kQ3GeometryTypeEllipsoid        EQU        'elpd'
  624. kQ3GeometryTypePolyhedron        EQU        'plhd'
  625. kQ3GeometryTypeTorus            EQU        'tors'
  626. kQ3GeometryTypeTriMesh            EQU        'tmsh'
  627. kQ3ShapeTypeShader                EQU        'shdr'
  628. kQ3ShaderTypeSurface            EQU        'sush'
  629. kQ3SurfaceShaderTypeTexture        EQU        'txsu'
  630. kQ3ShaderTypeIllumination        EQU        'ilsh'
  631. kQ3IlluminationTypePhong        EQU        'phil'
  632. kQ3IlluminationTypeLambert        EQU        'lmil'
  633. kQ3IlluminationTypeNULL            EQU        'nuil'
  634. kQ3ShapeTypeStyle                EQU        'styl'
  635. kQ3StyleTypeBackfacing            EQU        'bckf'
  636. kQ3StyleTypeInterpolation        EQU        'intp'
  637. kQ3StyleTypeFill                EQU        'fist'
  638. kQ3StyleTypePickID                EQU        'pkid'
  639. kQ3StyleTypeReceiveShadows        EQU        'rcsh'
  640. kQ3StyleTypeHighlight            EQU        'high'
  641. kQ3StyleTypeSubdivision            EQU        'sbdv'
  642. kQ3StyleTypeOrientation            EQU        'ofdr'
  643. kQ3StyleTypePickParts            EQU        'pkpt'
  644. kQ3StyleTypeAntiAlias            EQU        'anti'
  645. kQ3ShapeTypeTransform            EQU        'xfrm'
  646. kQ3TransformTypeMatrix            EQU        'mtrx'
  647. kQ3TransformTypeScale            EQU        'scal'
  648. kQ3TransformTypeTranslate        EQU        'trns'
  649. kQ3TransformTypeRotate            EQU        'rott'
  650. kQ3TransformTypeRotateAboutPoint EQU    'rtap'
  651. kQ3TransformTypeRotateAboutAxis    EQU        'rtaa'
  652. kQ3TransformTypeQuaternion        EQU        'qtrn'
  653. kQ3TransformTypeReset            EQU        'rset'
  654. kQ3ShapeTypeLight                EQU        'lght'
  655. kQ3LightTypeAmbient                EQU        'ambn'
  656. kQ3LightTypeDirectional            EQU        'drct'
  657. kQ3LightTypePoint                EQU        'pntl'
  658. kQ3LightTypeSpot                EQU        'spot'
  659. kQ3ShapeTypeCamera                EQU        'cmra'
  660. kQ3CameraTypeOrthographic        EQU        'orth'
  661. kQ3CameraTypeViewPlane            EQU        'vwpl'
  662. kQ3CameraTypeViewAngleAspect    EQU        'vana'
  663. kQ3ShapeTypeGroup                EQU        'grup'
  664. kQ3GroupTypeDisplay                EQU        'dspg'
  665. kQ3DisplayGroupTypeOrdered        EQU        'ordg'
  666. kQ3DisplayGroupTypeIOProxy        EQU        'iopx'
  667. kQ3GroupTypeLight                EQU        'lghg'
  668. kQ3GroupTypeInfo                EQU        'info'
  669. kQ3ShapeTypeUnknown                EQU        'unkn'
  670. kQ3UnknownTypeText                EQU        'uktx'
  671. kQ3UnknownTypeBinary            EQU        'ukbn'
  672. kQ3ShapeTypeReference            EQU        'rfrn'
  673. kQ3ReferenceTypeExternal        EQU        'rfex'
  674. kQ3SharedTypeSet                EQU        'set '
  675. kQ3SetTypeAttribute                EQU        'attr'
  676. kQ3SharedTypeDrawContext        EQU        'dctx'
  677. kQ3DrawContextTypePixmap        EQU        'dpxp'
  678. kQ3DrawContextTypeMacintosh        EQU        'dmac'
  679. kQ3DrawContextTypeWin32DC        EQU        'dw32'
  680. kQ3DrawContextTypeDDSurface        EQU        'ddds'
  681. kQ3DrawContextTypeX11            EQU        'dx11'
  682. kQ3SharedTypeTexture            EQU        'txtr'
  683. kQ3TextureTypePixmap            EQU        'txpm'
  684. kQ3TextureTypeMipmap            EQU        'txmm'
  685. kQ3SharedTypeFile                EQU        'file'
  686. kQ3SharedTypeStorage            EQU        'strg'
  687. kQ3StorageTypeMemory            EQU        'mems'
  688. kQ3MemoryStorageTypeHandle        EQU        'hndl'
  689. kQ3StorageTypeUnix                EQU        'uxst'
  690. kQ3UnixStorageTypePath            EQU        'unix'
  691. kQ3StorageTypeMacintosh            EQU        'macn'
  692. kQ3MacintoshStorageTypeFSSpec    EQU        'macp'
  693. kQ3StorageTypeWin32                EQU        'wist'
  694. kQ3SharedTypeString                EQU        'strn'
  695. kQ3StringTypeCString            EQU        'strc'
  696. kQ3SharedTypeShapePart            EQU        'sprt'
  697. kQ3ShapePartTypeMeshPart        EQU        'spmh'
  698. kQ3MeshPartTypeMeshFacePart        EQU        'mfac'
  699. kQ3MeshPartTypeMeshEdgePart        EQU        'medg'
  700. kQ3MeshPartTypeMeshVertexPart    EQU        'mvtx'
  701. kQ3SharedTypeControllerState    EQU        'ctst'
  702. kQ3SharedTypeTracker            EQU        'trkr'
  703. kQ3SharedTypeViewHints            EQU        'vwhn'
  704. kQ3SharedTypeEndGroup            EQU        'endg'
  705. ; ******************************************************************************
  706. ; **                                                                             **
  707. ; **                            QuickDraw 3D System Routines                     **
  708. ; **                                                                             **
  709. ; ****************************************************************************
  710.  
  711. ;
  712. ; extern TQ3Status Q3Initialize(void )
  713. ;
  714.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  715.         IMPORT_CFM_FUNCTION Q3Initialize
  716.     ENDIF
  717.  
  718. ;
  719. ; extern TQ3Status Q3Exit(void )
  720. ;
  721.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  722.         IMPORT_CFM_FUNCTION Q3Exit
  723.     ENDIF
  724.  
  725. ;
  726. ; extern TQ3Boolean Q3IsInitialized(void )
  727. ;
  728.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  729.         IMPORT_CFM_FUNCTION Q3IsInitialized
  730.     ENDIF
  731.  
  732. ;
  733. ; extern TQ3Status Q3GetVersion(unsigned long *majorRevision, unsigned long *minorRevision)
  734. ;
  735.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  736.         IMPORT_CFM_FUNCTION Q3GetVersion
  737.     ENDIF
  738.  
  739. ; *  Q3GetReleaseVersion returns the release version number,
  740. ; *  in the format of the first four bytes of a 'vers' resource
  741. ; *  (e.g. 0x01518000 ==> 1.5.1 release).
  742.  
  743. ;
  744. ; extern TQ3Status Q3GetReleaseVersion(unsigned long *releaseRevision)
  745. ;
  746.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  747.         IMPORT_CFM_FUNCTION Q3GetReleaseVersion
  748.     ENDIF
  749.  
  750.  
  751. ; ******************************************************************************
  752. ; **                                                                             **
  753. ; **                            ObjectClass Routines                             **
  754. ; **                                                                             **
  755. ; ****************************************************************************
  756.  
  757. ;  
  758. ; *  New object system calls to query the object system.
  759. ; *
  760. ; *  These comments to move to the stubs file before final release, they 
  761. ; *  are here for documentation for developers using early seeds.
  762.  
  763. ; *  Given a class name as a string return the associated class type for the 
  764. ; *  class, may return kQ3Failure if the string representing the class is 
  765. ; *  invalid.
  766.  
  767. ;
  768. ; extern TQ3Status Q3ObjectHierarchy_GetTypeFromString(TQ3ObjectClassNameString objectClassString, TQ3ObjectType *objectClassType)
  769. ;
  770.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  771.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetTypeFromString
  772.     ENDIF
  773.  
  774. ; *  Given a class type as return the associated string for the class name, 
  775. ; *  may return kQ3Failure if the type representing the class is invalid.
  776.  
  777. ;
  778. ; extern TQ3Status Q3ObjectHierarchy_GetStringFromType(TQ3ObjectType objectClassType, TQ3ObjectClassNameString objectClassString)
  779. ;
  780.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  781.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetStringFromType
  782.     ENDIF
  783.  
  784. ;  
  785. ; *  Return true if the class with this type is registered, false if not 
  786.  
  787. ;
  788. ; extern TQ3Boolean Q3ObjectHierarchy_IsTypeRegistered(TQ3ObjectType objectClassType)
  789. ;
  790.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  791.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_IsTypeRegistered
  792.     ENDIF
  793.  
  794. ;  
  795. ; *  Return true if the class with this name is registered, false if not 
  796.  
  797. ;
  798. ; extern TQ3Boolean Q3ObjectHierarchy_IsNameRegistered(const char *objectClassName)
  799. ;
  800.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  801.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_IsNameRegistered
  802.     ENDIF
  803.  
  804. ; * TQ3SubClassData is used when querying the object system for
  805. ; * the subclasses of a particular parent type:
  806.  
  807. TQ3SubClassData            RECORD 0
  808. numClasses                 ds.l    1                ; offset: $0 (0)        ;  the # of subclass types found for a parent class 
  809. classTypes                 ds.l    1                ; offset: $4 (4)        ;  an array containing the class types 
  810. sizeof                     EQU *                    ; size:   $8 (8)
  811.                         ENDR
  812. ; *  Given a parent type and an instance of the TQ3SubClassData struct fill
  813. ; *  it in with the number and class types of all of the subclasses immediately
  814. ; *  below the parent in the class hierarchy.  Return kQ3Success to indicate no
  815. ; *  errors occurred, else kQ3Failure.
  816. ; *
  817. ; *  NOTE:  This function will allocate memory for the classTypes array.  Be 
  818. ; *    sure to call Q3ObjectClass_EmptySubClassData to free this memory up.
  819.  
  820. ;
  821. ; extern TQ3Status Q3ObjectHierarchy_GetSubClassData(TQ3ObjectType objectClassType, TQ3SubClassData *subClassData)
  822. ;
  823.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  824.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetSubClassData
  825.     ENDIF
  826.  
  827. ; *  Given an instance of the TQ3SubClassData struct free all memory allocated 
  828. ; *    by the Q3ObjectClass_GetSubClassData call.
  829. ; *
  830. ; *  NOTE: This call MUST be made after a call to Q3ObjectClass_GetSubClassData
  831. ; *  to avoid memory leaks.
  832.  
  833. ;
  834. ; extern TQ3Status Q3ObjectHierarchy_EmptySubClassData(TQ3SubClassData *subClassData)
  835. ;
  836.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  837.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_EmptySubClassData
  838.     ENDIF
  839.  
  840.  
  841. ; ******************************************************************************
  842. ; **                                                                             **
  843. ; **                                Object Routines                                 **
  844. ; **                                                                             **
  845. ; ****************************************************************************
  846.  
  847. ;
  848. ; extern TQ3Status Q3Object_Dispose(TQ3Object object)
  849. ;
  850.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  851.         IMPORT_CFM_FUNCTION Q3Object_Dispose
  852.     ENDIF
  853.  
  854. ;
  855. ; extern TQ3Object Q3Object_Duplicate(TQ3Object object)
  856. ;
  857.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  858.         IMPORT_CFM_FUNCTION Q3Object_Duplicate
  859.     ENDIF
  860.  
  861. ;
  862. ; extern TQ3Status Q3Object_Submit(TQ3Object object, TQ3ViewObject view)
  863. ;
  864.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  865.         IMPORT_CFM_FUNCTION Q3Object_Submit
  866.     ENDIF
  867.  
  868. ;
  869. ; extern TQ3Boolean Q3Object_IsDrawable(TQ3Object object)
  870. ;
  871.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  872.         IMPORT_CFM_FUNCTION Q3Object_IsDrawable
  873.     ENDIF
  874.  
  875. ;
  876. ; extern TQ3Boolean Q3Object_IsWritable(TQ3Object object, TQ3FileObject theFile)
  877. ;
  878.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  879.         IMPORT_CFM_FUNCTION Q3Object_IsWritable
  880.     ENDIF
  881.  
  882.  
  883. ; ******************************************************************************
  884. ; **                                                                             **
  885. ; **                            Object Type Routines                             **
  886. ; **                                                                             **
  887. ; ****************************************************************************
  888.  
  889. ;
  890. ; extern TQ3ObjectType Q3Object_GetType(TQ3Object object)
  891. ;
  892.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  893.         IMPORT_CFM_FUNCTION Q3Object_GetType
  894.     ENDIF
  895.  
  896. ;
  897. ; extern TQ3ObjectType Q3Object_GetLeafType(TQ3Object object)
  898. ;
  899.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  900.         IMPORT_CFM_FUNCTION Q3Object_GetLeafType
  901.     ENDIF
  902.  
  903. ;
  904. ; extern TQ3Boolean Q3Object_IsType(TQ3Object object, TQ3ObjectType theType)
  905. ;
  906.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  907.         IMPORT_CFM_FUNCTION Q3Object_IsType
  908.     ENDIF
  909.  
  910.  
  911. ; ******************************************************************************
  912. ; **                                                                             **
  913. ; **                            Shared Object Routines                             **
  914. ; **                                                                             **
  915. ; ****************************************************************************
  916.  
  917. ;
  918. ; extern TQ3ObjectType Q3Shared_GetType(TQ3SharedObject sharedObject)
  919. ;
  920.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  921.         IMPORT_CFM_FUNCTION Q3Shared_GetType
  922.     ENDIF
  923.  
  924. ;
  925. ; extern TQ3SharedObject Q3Shared_GetReference(TQ3SharedObject sharedObject)
  926. ;
  927.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  928.         IMPORT_CFM_FUNCTION Q3Shared_GetReference
  929.     ENDIF
  930.  
  931. ;  
  932. ; *    Q3Shared_IsReferenced
  933. ; *        Returns kQ3True if there is more than one reference to sharedObject.
  934. ; *        Returns kQ3False if there is ONE reference to sharedObject.
  935. ; *    
  936. ; *    This call is intended to allow applications and plug-in objects to delete
  937. ; *    objects of which they hold THE ONLY REFERENCE. This is useful when
  938. ; *    caching objects, etc.
  939. ; *    
  940. ; *    Although many may be tempted, DO NOT DO THIS:
  941. ; *        while (Q3Shared_IsReferenced(foo)) { Q3Object_Dispose(foo); }
  942. ; *    
  943. ; *    Your application will crash and no one will buy it. Chapter 11 is 
  944. ; *    never fun (unless you short the stock). Thanks.
  945.  
  946. ;
  947. ; extern TQ3Boolean Q3Shared_IsReferenced(TQ3SharedObject sharedObject)
  948. ;
  949.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  950.         IMPORT_CFM_FUNCTION Q3Shared_IsReferenced
  951.     ENDIF
  952.  
  953. ; *    Q3Shared_GetEditIndex
  954. ; *        Returns the "serial number" of sharedObject. Usefuly for caching 
  955. ; *        object information. Returns 0 on error.
  956. ; *        
  957. ; *        Hold onto this number to determine if an object has changed since you
  958. ; *        last built your caches... To validate, do:
  959. ; *        
  960. ; *        if (Q3Shared_GetEditIndex(foo) == oldFooEditIndex) {
  961. ; *            // Cache is valid
  962. ; *        } else {
  963. ; *            // Cache is invalid
  964. ; *            RebuildSomeSortOfCache(foo);
  965. ; *            oldFooEditIndex = Q3Shared_GetEditIndex(foo);
  966. ; *        }
  967.  
  968. ;
  969. ; extern unsigned long Q3Shared_GetEditIndex(TQ3SharedObject sharedObject)
  970. ;
  971.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  972.         IMPORT_CFM_FUNCTION Q3Shared_GetEditIndex
  973.     ENDIF
  974.  
  975. ; *    Q3Shared_Edited
  976. ; *        Bumps the "serial number" of sharedObject to a different value. This
  977. ; *        call is intended to be used solely from a plug-in object which is 
  978. ; *        shared. Call this whenever your private instance data changes.
  979. ; *        
  980. ; *        Returns kQ3Failure iff sharedObject is not a shared object, OR
  981. ; *            QuickDraw 3D isn't initialized.
  982.  
  983. ;
  984. ; extern TQ3Status Q3Shared_Edited(TQ3SharedObject sharedObject)
  985. ;
  986.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  987.         IMPORT_CFM_FUNCTION Q3Shared_Edited
  988.     ENDIF
  989.  
  990.  
  991. ; ******************************************************************************
  992. ; **                                                                             **
  993. ; **                                Shape Routines                                 **
  994. ; **                                                                             **
  995. ; ****************************************************************************
  996.  
  997. ; *    QuickDraw 3D 1.5 Note:
  998. ; *
  999. ; *    Shapes and Sets are now (sort of) polymorphic.
  1000. ; *
  1001. ; *        You may call Q3Shape_Foo or Q3Set_Foo on a shape or a set.
  1002. ; *        The following calls are identical, in implementation:
  1003. ; *
  1004. ; *            Q3Shape_GetElement            =    Q3Set_Get
  1005. ; *            Q3Shape_AddElement            =    Q3Set_Add
  1006. ; *            Q3Shape_ContainsElement        =    Q3Set_Contains
  1007. ; *            Q3Shape_GetNextElementType    =    Q3Set_GetNextElementType
  1008. ; *            Q3Shape_EmptyElements        =    Q3Set_Empty
  1009. ; *            Q3Shape_ClearElement        =    Q3Set_Clear
  1010. ; *
  1011. ; *    All of these calls accept a shape or a set as their first parameter.
  1012. ; *
  1013. ; *    The Q3Shape_GetSet and Q3ShapeSetSet calls are implemented via a new
  1014. ; *    element type kQ3ElementTypeSet. See the note above about 
  1015. ; *    kQ3ElementTypeSet;
  1016. ; *
  1017. ; *    It is important to note that the new Q3Shape_...Element... calls do not
  1018. ; *    create a set on a shape and then add the element to it. This data is
  1019. ; *    attached directly to the shape. Therefore, it is possible for an element
  1020. ; *    to exist on a shape without a set existing on it as well. 
  1021. ; *
  1022. ; *    In your application, if you attach an element to a shape like this:
  1023. ; *        (this isn't checking for errors for simplicity)
  1024. ; *
  1025. ; *        set = Q3Set_New();
  1026. ; *        Q3Set_AddElement(set, kMyElemType, &data);
  1027. ; *        Q3Shape_SetSet(shape, set);
  1028. ; *
  1029. ; *    You should retrieve it in the same manner:
  1030. ; *
  1031. ; *        Q3Shape_GetSet(shape, &set);
  1032. ; *        if (Q3Set_Contains(set, kMyElemType) == kTrue) {
  1033. ; *            Q3Set_Get(set, kMyElemType, &data);
  1034. ; *        }
  1035. ; *
  1036. ; *    Similarly, if you attach data to a shape with the new calls:
  1037. ; *
  1038. ; *        Q3Shape_AddElement(shape, kMyElemType, &data);
  1039. ; *
  1040. ; *    You should retrieve it in the same manner:
  1041. ; *
  1042. ; *        if (Q3Shape_ContainsElement(set, kMyElemType) == kTrue) {
  1043. ; *            Q3Shape_GetElement(set, kMyElemType, &data);
  1044. ; *        }
  1045. ; *
  1046. ; *    This really becomes an issue when dealing with version 1.0 and version 1.1 
  1047. ; *    metafiles.
  1048. ; *
  1049. ; *    When attempting to find a particular element on a shape, you should
  1050. ; *    first check with Q3Shape_GetNextElementType or Q3Shape_GetElement, then,
  1051. ; *    Q3Shape_GetSet(s, &set) (or Q3Shape_GetElement(s, kQ3ElementTypeSet, &set))
  1052. ; *    and then Q3Shape_GetElement(set, ...).
  1053. ; *
  1054. ; *    In terms of implementation, Q3Shape_SetSet and Q3Shape_GetSet should only be
  1055. ; *    used for sets of information that are shared among multiple shapes.
  1056. ; *    
  1057. ; *    Q3Shape_AddElement, Q3Shape_GetElement, etc. calls should only be used
  1058. ; *    for elements that are unique for a particular shape.
  1059. ; *    
  1060.  
  1061. ;
  1062. ; extern TQ3ObjectType Q3Shape_GetType(TQ3ShapeObject shape)
  1063. ;
  1064.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1065.         IMPORT_CFM_FUNCTION Q3Shape_GetType
  1066.     ENDIF
  1067.  
  1068. ;
  1069. ; extern TQ3Status Q3Shape_GetSet(TQ3ShapeObject shape, TQ3SetObject *theSet)
  1070. ;
  1071.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1072.         IMPORT_CFM_FUNCTION Q3Shape_GetSet
  1073.     ENDIF
  1074.  
  1075. ;
  1076. ; extern TQ3Status Q3Shape_SetSet(TQ3ShapeObject shape, TQ3SetObject theSet)
  1077. ;
  1078.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1079.         IMPORT_CFM_FUNCTION Q3Shape_SetSet
  1080.     ENDIF
  1081.  
  1082. ;
  1083. ; extern TQ3Status Q3Shape_AddElement(TQ3ShapeObject shape, TQ3ElementType theType, const void *data)
  1084. ;
  1085.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1086.         IMPORT_CFM_FUNCTION Q3Shape_AddElement
  1087.     ENDIF
  1088.  
  1089. ;
  1090. ; extern TQ3Status Q3Shape_GetElement(TQ3ShapeObject shape, TQ3ElementType theType, void *data)
  1091. ;
  1092.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1093.         IMPORT_CFM_FUNCTION Q3Shape_GetElement
  1094.     ENDIF
  1095.  
  1096. ;
  1097. ; extern TQ3Boolean Q3Shape_ContainsElement(TQ3ShapeObject shape, TQ3ElementType theType)
  1098. ;
  1099.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1100.         IMPORT_CFM_FUNCTION Q3Shape_ContainsElement
  1101.     ENDIF
  1102.  
  1103. ;
  1104. ; extern TQ3Status Q3Shape_GetNextElementType(TQ3ShapeObject shape, TQ3ElementType *theType)
  1105. ;
  1106.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1107.         IMPORT_CFM_FUNCTION Q3Shape_GetNextElementType
  1108.     ENDIF
  1109.  
  1110. ;
  1111. ; extern TQ3Status Q3Shape_EmptyElements(TQ3ShapeObject shape)
  1112. ;
  1113.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1114.         IMPORT_CFM_FUNCTION Q3Shape_EmptyElements
  1115.     ENDIF
  1116.  
  1117. ;
  1118. ; extern TQ3Status Q3Shape_ClearElement(TQ3ShapeObject shape, TQ3ElementType theType)
  1119. ;
  1120.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1121.         IMPORT_CFM_FUNCTION Q3Shape_ClearElement
  1122.     ENDIF
  1123.  
  1124.  
  1125. ; ******************************************************************************
  1126. ; **                                                                             **
  1127. ; **                            Color Table Routines                             **
  1128. ; **                                                                             **
  1129. ; ****************************************************************************
  1130.  
  1131. ;
  1132. ; extern TQ3Status Q3Bitmap_Empty(TQ3Bitmap *bitmap)
  1133. ;
  1134.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1135.         IMPORT_CFM_FUNCTION Q3Bitmap_Empty
  1136.     ENDIF
  1137.  
  1138. ;
  1139. ; extern unsigned long Q3Bitmap_GetImageSize(unsigned long width, unsigned long height)
  1140. ;
  1141.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1142.         IMPORT_CFM_FUNCTION Q3Bitmap_GetImageSize
  1143.     ENDIF
  1144.  
  1145.  
  1146.  
  1147.     ENDIF ; __QD3D__ 
  1148.  
  1149.